1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a computer program product.
2. Description of the Related Art
In general, image processing apparatuses, such as copiers, handle an original as a collection of pixels, each having a tiny area, and represent the color of each pixel by values (tone values), each indicating the intensity (luminance) of any of color components R (red), G(green), and B (blue) that are the three primary colors of light, in order to output an image, in which the color shade of the original is accurately reproduced, through printing or the like. In recent years, image processing apparatuses have been required to realize not only the function of accurately reproducing the color shade of a color original but also various other functions, such as a function of converting a color original into a black-and-white (monochrome) image for output or a function of converting a color original into a two-color image formed of achromatic color and chromatic color for output, by processing the tone values of the above color components in accordance with user's needs.
As for the method of converting a color image into a monochrome image, a conventional method has been known, in which a tone value of each of the RGB color components of each of pixels contained in a color image is multiplied by a predetermined weighting factor, and the sum of the multiplied tone values is used as a tone value that represents the luminance of the pixel in order to generate a monochrome image. However, in the conventional method, when colors in an original have almost the same luminance, even if the colors differ in hue, the colors are represented at the same concentration in a monochrome image. Therefore, there is a problem in that a difference between colors in an original cannot be appropriately represented in a monochrome image.
As a method for addressing the above problem, there is a known method, in which, when a large number of colors are used in an image of an original and if a variation range of the luminance in a monochrome image obtained by conversion is narrow, the luminance of a pixel having a color that is most frequently used in the image of the original is increased in the monochrome image in order to enhance this color (see, for example, Japanese Patent No. 4304846). Furthermore, there is another known method, in which the appearance frequency (the number of pixels) is obtained for each hue of colors contained in an image of an original, a color contained in the hue with the highest appearance frequency is determined as a feature color, and the luminance of each pixel having the feature color is enhanced in a monochrome image (see, for example, Japanese Patent Application Laid-open No. 2007-215216).
Moreover, there is still another known method, in which the color of each pixel contained in an image of an original is plotted on the a*b* plane of the L*a*b* color space, a predetermined angle is added to a hue angle of each plot to convert the hue, differences in the tone values of respective RGB components between before and after the hue conversion are averaged, and the average is added to a luminance value that has been calculated before the hue conversion, so as to generate a monochrome image with a color image taken into consideration (see, for example, Japanese Patent Application Laid-open No. 2009-89382).
However, in the conventional methods disclosed in Japanese Patent No. 4304846 and Japanese Patent Application Laid-open No. 2007-215216, because only a color with the highest appearance frequency in an input image is enhanced in an output image, various hues contained in the input image cannot be distinguished by shade differences in a monochrome image. Furthermore, in the conventional method disclosed in Japanese Patent Application Laid-open No. 2009-89382, whether the average of the differences in the tone values of the respective RGB components between before and after the hue conversion is an appropriate value or not depends on the color distribution of an input image. Therefore, in some cases, it may be difficult to obtain an appropriate shade difference, depending on the color distribution of an input image.